add_library(ben_corelib SHARED
                       ${CMAKE_CURRENT_SOURCE_DIR}/codecs/qtextcodec/main.cpp
                       ${CMAKE_CURRENT_SOURCE_DIR}/io/qprocess/tst_bench_qprocess.cpp
                       ${CMAKE_CURRENT_SOURCE_DIR}/json/tst_bench_qtbinaryjson.cpp
                       ${CMAKE_CURRENT_SOURCE_DIR}/kernel/qmetatype/tst_qmetatype.cpp
                       ${CMAKE_CURRENT_SOURCE_DIR}/kernel/qtimer_vs_qmetaobject/tst_qtimer_vs_qmetaobject.cpp
                       ${CMAKE_CURRENT_SOURCE_DIR}/kernel/qvariant/tst_qvariant.cpp
                       ${CMAKE_CURRENT_SOURCE_DIR}/plugin/quuid/tst_quuid.cpp
                       ${CMAKE_CURRENT_SOURCE_DIR}/thread/qmutex/tst_qmutex.cpp
                       ${CMAKE_CURRENT_SOURCE_DIR}/thread/qreadwritelock/tst_qreadwritelock.cpp
                       ${CMAKE_CURRENT_SOURCE_DIR}/thread/qthreadpool/tst_qthreadpool.cpp
                       ${CMAKE_CURRENT_SOURCE_DIR}/thread/qthreadstorage/tst_qthreadstorage.cpp
                       ${CMAKE_CURRENT_SOURCE_DIR}/thread/qwaitcondition/tst_qwaitcondition.cpp
                       ${CMAKE_CURRENT_SOURCE_DIR}/tools/qalgorithms/tst_qalgorithms.cpp
)

find_package(QT NAMES Qt5 Qt6 REQUIRED COMPONENTS Core)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Test Widgets)
target_link_libraries(ben_corelib PRIVATE Qt${QT_VERSION_MAJOR}::Core
                                         Qt${QT_VERSION_MAJOR}::CorePrivate
                                         Qt${QT_VERSION_MAJOR}::Test
                                         Qt${QT_VERSION_MAJOR}::Widgets)